package com.ifdom.thread.threethreadprintingABC;

/**
 * 经典面试题：三线程打印ABC
 **/
public class thread3Print {
    public static void main(String[] args) throws Exception {
        Object a = new Object();
        Object b = new Object();
        Object c = new Object();
        Thread aThread = new Thread(new IndexRunnable("a", a, c));
        Thread bThread = new Thread(new IndexRunnable("b", b, a));
        Thread cThread = new Thread(new IndexRunnable("c", c, b));

        aThread.start();
        Thread.sleep(100);
        bThread.start();
        Thread.sleep(100);
        cThread.start();
        Thread.sleep(100);
    }

}